<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  <title>Create Campaign - Magneto, by Protoweb</title>

  {include file="head-common.html"}

  <script type="text/javascript">
    jQuery(document).ready(function(){
      
      jQuery('ul.thumbnails li a').on('click',function(event) {
        event.preventDefault();

        // in this context jQuery(this) means the A tag
        jQuery('#template').val(jQuery(this).data('tplid'));

        jQuery('ul.thumbnails li a').removeClass("thumbnail-selected");
        jQuery(this).addClass("thumbnail-selected");
      })

    }) // document ready
  </script>

</head>

<body>

  {include file="header.html"}

  <div class="main container">

    <h1 class="over-bg antialias-white">Create Campaign</h1>

    {include file="messages_managment.html"}

    <section class="row">
      <form class="span8 well" action="" method="post" enctype="multipart/form-data">

          <div class="control-group">
            <input id="template" name="template" type="hidden" value="" />
            <h2>Template selection</h2>
            <ul class="thumbnails">
              {foreach from=$templates item="tpl"}
              <li class="span2">
                <a data-tplid="{$tpl->id}" href="#" title="{$tpl->name}" class="thumbnail{if $tpl->id === $campaign->template_id} thumbnail-selected{/if}{if $campaign} no-follow{/if}">
                  <img src="{$templates_path}{$tpl->keyname}/{$tpl->keyname}.png" alt="{$tpl->name}" />
                </a>
                {$tpl->name}
              </li>
              {/foreach}
            </ul>
          </div>

          <h2>Campaign Settings</h2>

          <div class="control-group row">
            
            <div class="span4">
              <label>Name</label>
              <input class="span4" type="text" name="name" value="{$client->from->name}" readonly="readonly" required />
            </div>

            <div class="span4">
              <label>From</label>
              <input class="span4" type="text" name="from" value="{$client->from->email}" readonly="readonly" required /> 
            </div>
          </div>

          <div class="control-group">
            <label>Subject</label>
            <input class="span8" type="text" name="subject" placeholder="Subject for this Campaign" value="{$campaign->subject}" required />
          </div>

        <div class="control-group">
          <button type="submit" class="btn btn-primary pull-right" name="button_save"><i class="icon-magnet icon-white"></i> Save and Edit Campaign</button>
        </div>

      </form>

      <div class="span3">
        <h2>Necesitas ayuda?</h2>
        <p>Si eres cliente y no recuerdas tus datos de acceso, podemos ayudarte a <a href="{controllers_url}users/remember/">recuperar tu contraseña</a>.</p>
        <p>Si eres un nuevo usuario, <a class="no-follow" href="{controllers_url}about/prices/">mira nuestros precios</a> o <a class="no-follow" href="{controllers_url}about/buy/">ponte en contacto</a> para crear tu acceso.</p>
      </div>

    </section>
    <!-- row -->

  </div>
  <!-- main container -->

  {include file="footer.html"}

</body>
</html>
